<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<div region="center" style="padding:5px;" border="false">
	<table id="terminalList">
		<thead>
			<tr>
				<th data-options="field:'terminalId',width:50,hidden:true">ID</th>
				<th data-options="field:'branch',width:200,formatter: function(value,row,index){
        			if(value){
						return value.branchName;
					}
					return '未知';
        		}">网点名称</th>
				<th data-options="field:'name',width:100">终端名称</th>
				<th data-options="field:'softVer',width:100">软件版本</th>
				<th data-options="field:'hardVer',width:100">硬件版本</th>
				<th data-options="field:'cardNumber',width:100">3g卡</th>
				<th data-options="field:'loginTime',width:200,formatter: function(value,row,index){
		        			if(value){
								return value.replace('T',' ');
							}
							return '未知';
		        		}">登录时间</th>
				<th data-options="field:'status',width:100,formatter: function(value,row,index){
		        			if(value){
								switch(value){
									case 0:return '在线';
									case 1:return '离线';
									default : break;
								}
							}
							return '未知';
		        		},styler: function(value,row,index){
		        			if(value==1){
								return 'background-color:#ffee00;color:red;'
							}
		        		}">当前状态</th>
			</tr>
		</thead>

		<%--<tbody>
			<s:iterator value="terminals" status="st">
				<tr class="odd">
					<td><s:property value="terminalId" /></td>
					<td class="center "><s:property value="branch.branchName" /></td>
					<td class="center "><s:property value="name" /></td>
					<td class="center "><s:property value="softVer" />&nbsp;/&nbsp;<s:property value="hardVer" />&nbsp;/&nbsp;<s:property value="cardNumber" /></td>
					<s:if test="status==1">
						<td class="center " style="background-color: #FF99FF"><s:date name="loginTime" format="yyyy-MM-dd HH:mm:ss"/></td>
					</s:if>
					<s:else>
						<td class="center "><s:date name="loginTime" format="yyyy-MM-dd HH:mm:ss"/></td>
					</s:else>
					<td class="center "> 
						<a class="ajax-link" href="getUntakenParcel!execute?terminalID=<s:property value="terminalId" />">
							剩余包裹
						</a>|
						<a class="ajax-link" href="goods!getUnTakenGoods?terminalID=<s:property value="terminalId" />">
							剩余物品
						</a>|
						<a class="ajax-link" href="boxList?terminalID=<s:property value="terminalId" />">
							箱子使用情况
						</a>|
					    <a href="Terminals!getTerminalDetails?terminalID=<s:property value="terminalId" />">
							设备详情
						</a>|
						<a href="getTerminalById?terminalID=<s:property value="terminalId" />">
							修改
						</a>|
						<a href="deleteTerminal?terminalID=<s:property value="terminalId" />">
							删除
						</a>|
						 <a href="javascript:void(0);"  class="ctrlOpen" data-toggle="modal" data-target="#myModal" data-attr="<s:property value="terminalId" />">终端控制</a>
					</td>
				</tr>
			</s:iterator>
		</tbody>
	--%></table>
</div>
<!-- 增加 -->
<div id="terminal_addDialog"></div>
<!-- 修改 -->
<div id="terminal_updateDialog"></div>
<script type="text/javascript" src="<%=path%>/js/system/terminal/terminal.js"></script>